#pragma once

#ifndef BUOYANCE_H
#define BUOYANCE_H

#include "ForceGenerator.h"

class Buoyancy : public ForceGenerator
{
private:
	/**
	 * Maximum submersion depth of the object before it
	 * generates its maximum buoyancy force.
	 */
	float maxDepth;
	/**
	 * The volume of the object.
	 */
	float volume;
	/**
	 * The height of the water plane above y = 0. The place
	 * will be parallel to the xz plane.
	 */
	float waterHeight;
	/**
	 * The denisity of the liquid. Pure water has a density
	 * of 1000kg per cubic meter.
	 */
	float liquidDensity;
public:
	/** Creates a new buoyancy force with the given parameters. */
	Buoyancy(float maxDepth, float volume, float waterHeight,
		float liquidDensity = 1000.0f) : maxDepth(maxDepth), 
		volume(volume), waterHeight(waterHeight),
		liquidDensity(liquidDensity)
	{
	}
	~Buoyancy() { }
	virtual void updateForce(Particle* particle, float frameTime);
};

#endif